﻿﻿<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
	<title>Sewise M3U8 src方式嵌入播放</title>
	<style type="text/css">
		body{
			margin: 0px;
			padding: 0px;
		}
	</style>
	<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
</head>
<body>
<div style="width: 700px; height: 300px; ">
	<script type="text/javascript" src="http://jackzhang1204.github.io/sewise/sewise_player/player/sewise.player.min.js"></script>
	<script type="text/javascript">
		var letvURL = "rtmp://tinywan.amai8.com/live123/4001481269282";
		var youkuURL = "http://amaitest.oss-cn-hangzhou.aliyuncs.com/record/live123/4001481265465.m3u8";
		var letvTitle = "播放001 M3U8";
		var youkuTitle = "播放002 M3U8";
		SewisePlayer.setup({
			server: "vod",
			type: "m3u8",
			videourl: letvURL,
			skin: "vodWhite",
			claritybutton: "disable",
			title: letvTitle,
			lang: 'zh_CN'
		});
		$(document).ready(function(){
			$("#switch").text(youkuTitle);
			$("#switch").click(function(e){
				if($("#switch").text() == youkuTitle){
					SewisePlayer.toPlay(youkuURL, youkuTitle, 0, true);
					$("#switch").text(letvTitle);
				}else{
					SewisePlayer.toPlay(letvURL, letvTitle, 0, true);
					$("#switch").text(youkuTitle);
				}
			});
		});
	</script>
</div>
<div style="padding: 20px;"><button id="switch" style="width: 120px; height: 30px; "></button></div>
<div style="padding: 10px;float: left;">这个是播放[m3u8],使用与如果两个m3u8文件的切换播放</div>
<div style="padding: 10px;float: left;">注：如果当前设备为Mobile平台，播放器将自动启用HTML5播放模块播放m3u8文件。</div>
</body>
</html>